<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div{
            width:300px;
            height: 300px;
            background: lightblue;
        }
    </style>
</head>
<body>
    <div>
        <button>点击</button>
    </div>
    
    <script>
        var div = document.querySelector("div")
        var btn = document.querySelector("button")

        div.onmouseenter = function(e){
            console.log("鼠标进入：enter", e)
        }

        div.onmouseleave = function(e){
            console.log("鼠标离开：leave", e)
        }

        // btn.onmouseover = function(e){
        //     e.stopPropagation();
        // }
        // btn.onmouseout = function(e){
        //     e.stopPropagation();
        // }
        // div.onmouseover = function(){
        //     console.log("进入：over");
        // }

        // div.onmouseout = function(){
        //     console.log("离开：out");
        // }
    </script>
</body>
</html>